Ext.define('App.commons.echarts.EchartsPanel', {
    extend: 'Ext.Container',
    alias: ['widget.EchartsPanel'],
    minHeight: 100,
    initComponent: function () {
        var me = this;
        if (!me.height) {
            throw new Error("图表组件要配置高度");
        }
        me.on("boxready", function () {
            me.initChart();
        });
        me.callParent();
    },
    initChart: function () {
        var me = this;
        me.echarts = echarts.init(me.getEl().dom);
        if (me.option) {
            me.echarts.setOption(me.option);
        }
    }
});